<extend name="Base/common" />
<block name="header">
    <header class="jumbotron subhead" id="overview">
        <div class="container">
            <h2>修改密码</h2>
            <p><span><span class="pull-left"></span> </span></p>
        </div>
    </header>
</block>

<block name="body">
        <div class="container" id="main-container">
    <section>
        <div class="col-md-3">
            <form role="form" action="__SELF__" method="post">
                <div class="control-group">
                    <label class="control-label" for="exampleInputEmail1">原密码</label>
                    <input type="password" id="inputPassword"  class="span3 form-control" placeholder="请输入密码"  errormsg="密码为6-20位" nullmsg="请填写密码" datatype="*6-20" name="old">
                </div>
                <div class="control-group">
                    <label class="control-label" for="exampleInputPassword1">新密码</label>
                    <input type="password" id="inputPassword"  class="span3 form-control" placeholder="请输入密码"  errormsg="密码为6-20位" nullmsg="请填写密码" datatype="*6-20" name="password">
                </div>
                <div class="control-group">
                    <label class="control-label" for="exampleInputPassword1">确认密码</label>
                    <input type="password" id="inputPassword" class="span3 form-control" placeholder="请再次输入密码" recheck="password" errormsg="您两次输入的密码不一致" nullmsg="请填确认密码" datatype="*" name="repassword">
                </div>  
                <div class="controls Validform_checktip text-danger"></div>
                <br/>
         <div class="control-group">
            <div class="controls">                      
              <button type="submit" class="btn btn-default">提 交</button>
            </div>
          </div>
            </form>
        </div>
    </section>
        </div>
</block>

<block name="side"></block>
<block name="script">
    <script type="text/javascript">

        $(document)
                .ajaxStart(function() {
                    $("button:submit").addClass("log-in").attr("disabled", true);
                })
                .ajaxStop(function() {
                    $("button:submit").removeClass("log-in").attr("disabled", false);
                });

        $("form").submit(function() {
            var self = $(this);
            $.post(self.attr("action"), self.serialize(), success, "json");
            return false;

            function success(data) {
                if (data.status) {
                    alert("密码修改成功！");
                    window.location.href = data.url;
                } else {
                    self.find(".Validform_checktip").text(data.info);
                }
            }
        });
    </script>
</block>
